<div class="user">
<h2>View User</h2>

	<dl>
		<dt>Id</dt>
		<dd>&nbsp;<?php echo $user['User']['id']?></dd>
		<dt>Username</dt>
		<dd>&nbsp;<?php echo $user['User']['username']?></dd>
		<dt>Passwd</dt>
		<dd>&nbsp;<?php echo $user['User']['passwd']?></dd>
		<dt>Name</dt>
		<dd>&nbsp;<?php echo $user['User']['name']?></dd>
		<dt>Email</dt>
		<dd>&nbsp;<?php echo $user['User']['email']?></dd>
		<dt>Last Visit</dt>
		<dd>&nbsp;<?php echo $user['User']['last_visit']?></dd>
		<dt>Group</dt>
		<dd>&nbsp;<?php echo $html->link($user['Group']['name'], array('controller'=> 'groups', 'action'=>'view', $user['Group']['id'])); ?></dd>
		<dt>Profile Id</dt>
		<dd>&nbsp;<?php echo $user['User']['profile_id']?></dd>
		<dt>Active</dt>
		<dd>&nbsp;<?php echo $user['User']['active']?></dd>
	</dl>
</div>
<div class="actions">
	<ul>
		<li><?php echo $html->link('Edit User',   array('action'=>'edit', $user['User']['id'])); ?> </li>
		<li><?php echo $html->link('Delete User', array('action'=>'delete', $user['User']['id']), null, 'Are you sure you want to delete #' . $user['User']['id'] . '?'); ?> </li>
		<li><?php echo $html->link('List Users', array('action'=>'index')); ?> </li>
		<li><?php echo $html->link('New User',	array('action'=>'add')); ?> </li>
		<li><?php echo $html->link('List Group', array('controller'=> 'groups', 'action'=>'index')); ?> </li>
		<li><?php echo $html->link('New Groups', array('controller'=> 'groups', 'action'=>'add')); ?> </li>
	</ul>

</div>
<div class="related">
<h3>Related Profiles</h3>
<?php if(!empty($user['Profile'])): ?>
	<dl>
		<dt>Id</dt>
		<dd>&nbsp;<?php echo $user['Profile']['id'] ?></dd>
		<dt>User Id</dt>
		<dd>&nbsp;<?php echo $user['Profile']['user_id'] ?></dd>
		<dt>Country</dt>
		<dd>&nbsp;<?php echo $user['Profile']['country'] ?></dd>
		<dt>Dob</dt>
		<dd>&nbsp;<?php echo $user['Profile']['dob'] ?></dd>
		<dt>Homepage</dt>
		<dd>&nbsp;<?php echo $user['Profile']['homepage'] ?></dd>
		<dt>Image</dt>
		<dd>&nbsp;<?php echo $user['Profile']['image'] ?></dd>
		<dt>Created</dt>
		<dd>&nbsp;<?php echo $user['Profile']['created'] ?></dd>
		<dt>Modified</dt>
		<dd>&nbsp;<?php echo $user['Profile']['modified'] ?></dd>
	</dl>
<?php endif; ?>
	<div class="actions">
		<ul>
			<li><?php echo $html->link('Edit Profile', array('controller'=> 'profiles', 'action'=>'edit', $user['Profile']['id']));?></li>
		</ul>
	</div>
</div>
<div class="related">
<h3>Related Events</h3>
<?php if(!empty($user['Event'])):?>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th>Id</th>
		<th>Venue</th>
		<th>Address</th>
		<th>City</th>
		<th>Country</th>
		<th>Event Type Id</th>
		<th>Event Date</th>
		<th>Event Time</th>
		<th>Event Url</th>
		<th>Notes</th>
		<th>User Id</th>
		<th>Published</th>
		<th>Created</th>
		<th>Modified</th>
		<th>Actions</th>
	</tr>
<?php foreach($user['Event'] as $event):?>
	<tr>
		<td><?php echo $event['id'];?></td>
		<td><?php echo $event['venue'];?></td>
		<td><?php echo $event['address'];?></td>
		<td><?php echo $event['city'];?></td>
		<td><?php echo $event['country'];?></td>
		<td><?php echo $event['event_type_id'];?></td>
		<td><?php echo $event['event_date'];?></td>
		<td><?php echo $event['event_time'];?></td>
		<td><?php echo $event['event_url'];?></td>
		<td><?php echo $event['notes'];?></td>
		<td><?php echo $event['user_id'];?></td>
		<td><?php echo $event['published'];?></td>
		<td><?php echo $event['created'];?></td>
		<td><?php echo $event['modified'];?></td>
		<td class="actions">
			<?php echo $html->link('View', array('controller'=> 'events', 'action'=>'view', $event['id'])); ?>
			<?php echo $html->link('Edit', array('controller'=> 'events', 'action'=>'edit', $event['id'])); ?>
			<?php echo $html->link('Delete', array('controller'=> 'events', 'action'=>'delete', $event['id']), null, 'Are you sure you want to delete #' . $event['id'] . '?'); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link('New Event', array('controller'=> 'events', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
<h3>Related Pages</h3>
<?php if(!empty($user['Page'])):?>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th>Id</th>
		<th>Url</th>
		<th>Title</th>
		<th>Body</th>
		<th>Published</th>
		<th>User Id</th>
		<th>Created</th>
		<th>Modified</th>
		<th>Actions</th>
	</tr>
<?php foreach($user['Page'] as $page):?>
	<tr>
		<td><?php echo $page['id'];?></td>
		<td><?php echo $page['url'];?></td>
		<td><?php echo $page['title'];?></td>
		<td><?php echo $page['body'];?></td>
		<td><?php echo $page['published'];?></td>
		<td><?php echo $page['user_id'];?></td>
		<td><?php echo $page['created'];?></td>
		<td><?php echo $page['modified'];?></td>
		<td class="actions">
			<?php echo $html->link('View', array('controller'=> 'pages', 'action'=>'view', $page['id'])); ?>
			<?php echo $html->link('Edit', array('controller'=> 'pages', 'action'=>'edit', $page['id'])); ?>
			<?php echo $html->link('Delete', array('controller'=> 'pages', 'action'=>'delete', $page['id']), null, 'Are you sure you want to delete #' . $page['id'] . '?'); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link('New Page', array('controller'=> 'pages', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
<div class="related">
<h3>Related Posts</h3>
<?php if(!empty($user['Post'])):?>
<table cellpadding="0" cellspacing="0">
	<tr>
		<th>Id</th>
		<th>Title</th>
		<th>Byline</th>
		<th>Body</th>
		<th>User Id</th>
		<th>Url</th>
		<th>Published</th>
		<th>Created</th>
		<th>Modified</th>
		<th>Actions</th>
	</tr>
<?php foreach($user['Post'] as $post):?>
	<tr>
		<td><?php echo $post['id'];?></td>
		<td><?php echo $post['title'];?></td>
		<td><?php echo $post['byline'];?></td>
		<td><?php echo $post['body'];?></td>
		<td><?php echo $post['user_id'];?></td>
		<td><?php echo $post['url'];?></td>
		<td><?php echo $post['published'];?></td>
		<td><?php echo $post['created'];?></td>
		<td><?php echo $post['modified'];?></td>
		<td class="actions">
			<?php echo $html->link('View', array('controller'=> 'posts', 'action'=>'view', $post['id'])); ?>
			<?php echo $html->link('Edit', array('controller'=> 'posts', 'action'=>'edit', $post['id'])); ?>
			<?php echo $html->link('Delete', array('controller'=> 'posts', 'action'=>'delete', $post['id']), null, 'Are you sure you want to delete #' . $post['id'] . '?'); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $html->link('New Post', array('controller'=> 'posts', 'action'=>'add'));?> </li>
		</ul>
	</div>
</div>
